<template>
  <v-overlay :value="overlay">

    <v-progress-circular indeterminate size="64"></v-progress-circular>

    <div>{{text}}</div>
  </v-overlay>
</template>

<script>
  export default {
    name: 'Loading',
    mounted() {

      this.$bus.$on('xy_inner_bus_loading', (notice) => {

        this.overlay = notice.value;
        this.text = notice.text;

        setTimeout(() => {
          this.overlay = false;
        }, 3000);

      });

    },
    data() {
      return {
        overlay: false,
        text: "",

      }
    },

    destroyed() {
      this.$bus.$off('xy_inner_bus_loading');
    }

  }

</script>
